package com.roam.controller;

import com.roam.DTO.ContentOnlyDTO;
import com.roam.result.Result;
import com.roam.service.SearchPageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@CrossOrigin
public class SearchPageController {
    @Autowired
    SearchPageService searchPageService;

    @PostMapping("/searchPage/get")
    public Result getPopularScenes(@RequestBody ContentOnlyDTO contentOnlyDTO) {

        String content=contentOnlyDTO.getContent();
        return Result.success(searchPageService.getSearchedScenes(content));

    }
}
